import request from '@/utils/request.js'
import { useTokenStore } from '@/stores/token';

//文章分类列表查询
export function articleCategoryListService() {
    // const tokenStore = useTokenStore();
    //在pinia中定义的响应式数据，都不需要.value
    // return request.get('/category',{headers:{'Authorization':tokenStore.token}});
    // return request.get('/category',{headers:{'Authorization':'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjbGFpbXMiOnsiaWQiOjIsInVzZXJuYW1lIjoibGlzaXdhbmcifSwiZXhwIjoxNzEwOTQ3MzQwfQ.s_lQF5fS2JwrmMVfCe5VJxF1MnWHynI2y1L36qEmx28'}});
    return request.get('/category');
}

export function articleCategoryAddService(categoryData){
    return request.post('/category',categoryData);
}

export function articleCategoryUpdateService(categoryData){
    return request.put('/category', categoryData);
}
export function articlecategoryDeleteService(id){
    return request.delete('/category?id='+id);
}



export function articleListService(params){
    // console.log('请求的数据');
    // console.log(params);
    return request.get('/article',{params: params});
}
export function articleAddService(articleData){
    return request.post('/article',articleData);
}